package com.yx;

import java.awt.Toolkit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wb.swt.SWTResourceManager;
import com.yx.admin.StartDialog;

public class AdminStarter {
	Shell shell = null;
	

	public AdminStarter() {
		// TODO 自动生成的构造函数存根
	}

	public static void main(String[] args) {
		try {
			AdminStarter window = new AdminStarter();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents(display);
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents(Display display) {
		int style =SWT.CLOSE | SWT.MIN|SWT.TOOL;
		shell = new Shell(display, style);
		shell.setText("SmartFrame - 云想科技");
		shell.setLayout(new FillLayout());
		int screenH = Toolkit.getDefaultToolkit().getScreenSize().height;
	    int screenW = Toolkit.getDefaultToolkit().getScreenSize().width;
		shell.setBounds(screenW-210, screenH-265, 184, 215);
		shell.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		
		StartDialog StartDialog = new StartDialog(shell, SWT.None);
		shell.addDisposeListener(new DisposeListener() {
			public void widgetDisposed(DisposeEvent e) {
				System.exit(0);
			}
		});
	}
}
